﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using CMS.Model;

namespace CMS.Contracts
{
    [ServiceContract]
    public interface IProjectBService
    {
        /// <summary>
        /// Gets all teachers.
        /// </summary>
        /// <returns>List of Teacher</returns>
        /// <remarks>ChangLiu</remarks>
        [OperationContract]
        List<Teacher> GetAllTeachers(int pageIndex, int pageSize, out int rowCount);
        [OperationContract]
        List<Teacher> GetAllTeacher();
        /// <summary>
        /// Gets the teacher by id.
        /// </summary>
        /// <param name="teacherId">The teacher id.</param>
        /// <returns>List of Teacher</returns>
        /// <remarks>ChangLiu</remarks>
        [OperationContract]
        List<Teacher> GetTeacherById(int teacherId);
        /// <summary>
        /// Adds the teacher.
        /// </summary>
        /// <param name="heacher">The teacher.</param>
        /// <returns>True or False</returns>
        /// <remarks>ChangLiu</remarks>
        [OperationContract]
        void AddTeacher(Teacher teacher);
        /// <summary>
        /// Updates the teacher.
        /// </summary>
        /// <param name="teacher">The teacher.</param>
        /// <returns>True or False</returns>
        /// <remarks>ChangLiu</remarks>
        [OperationContract]
        void UpdateTeacher(Teacher teacher);
        /// <summary>
        /// Deletes the teacher by id.
        /// </summary>
        /// <param name="teacherId">The teacher id.</param>
        /// <returns>True or False</returns>
        /// <remarks>ChangLiu</remarks>
        [OperationContract]
        void DeleteTeacherById(int teacherId);
        /// <summary>
        /// Gets all departments.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<Department> GetAllDepartments();
        /// <summary>
        /// Gets the department by id.
        /// </summary>
        /// <param name="departmentId">The department id.</param>
        /// <returns></returns>
        [OperationContract]
        List<Department> GetDepartmentById(int departmentId);
        /// <summary>
        /// Adds the department.
        /// </summary>
        /// <param name="department">The department.</param>
        [OperationContract]
        void AddDepartment(Department department);
        /// <summary>
        /// Updates the department.
        /// </summary>
        /// <param name="department">The department.</param>
        [OperationContract]
        void UpdateDepartment(Department department);
        /// <summary>
        /// Deletes the department by id.
        /// </summary>
        /// <param name="teacherId">The teacher id.</param>
        [OperationContract]
        void DeleteDepartmentById(int teacherId);
        /// <summary>
        /// Gets all students.
        /// </summary>
        /// <returns>List of Student</returns>
        /// <remarks>RebeccaNiu</remarks>
        [OperationContract]
        List<CMS.Model.Student> GetAllStudents(int pageIndex, int pageSize, out int rowCount);
        /// <summary>
        /// Gets the student by id.
        /// </summary>
        /// <param name="studentId">The student id.</param>
        /// <returns>List of Student</returns>
        /// <remarks>RebeccaNiu</remarks>
        [OperationContract]
        Student GetStudentById(int studentId);
        /// <summary>
        /// Adds the student.
        /// </summary>
        /// <param name="student">The student.</param>
        /// <remarks>RebeccaNiu</remarks>
        [OperationContract]
        void AddStudent(Student student);
        /// <summary>
        /// Updates the st cudent.
        /// </summary>
        /// <param name="student">The student.</param>
        /// <remarks>RebeccaNiu</remarks>
        [OperationContract]
        void UpdateStudent(Student student);
        /// <summary>
        /// Deletes the student by id.
        /// </summary>
        /// <param name="studentId">The student id.</param>
        /// <remarks>RebeccaNiu</remarks>
        [OperationContract]
        [FaultContract(typeof(InvalidOperationException))]
        void DeleteStudentById(int studentId);
        /// <summary>
        /// Gets all grades.
        /// </summary>
        /// <returns>List of Grade</returns>
        /// <remarks>RebeccaNiu</remarks>
        [OperationContract]
        List<Grade> GetAllGrades();
        /// <summary>
        /// Gets the course by id.
        /// </summary>
        /// <param name="courseId">The course id.</param>
        /// <returns></returns>
        [OperationContract]
        List<CMS.Model.Course> GetCourseById(int courseId);
        /// <summary>
        /// Adds the course.
        /// </summary>
        /// <param name="course">The course.</param>
        /// <returns></returns>
        [OperationContract]
        int AddCourse(Course course);
        [OperationContract]
        void AddCourseDetail(CourseDetails courseDetail);
        /// <summary>
        /// Updates the course.
        /// </summary>
        /// <param name="course">The course.</param>
        [OperationContract]
        void UpdateCourse(Course course);
        /// <summary>
        /// Deletes all students by course id.
        /// </summary>
        /// <param name="courseId">The course id.</param>
        [OperationContract]
        void DeleteAllStudentsByCourseId(int courseId);
        /// <summary>
        /// Gets the students in course.
        /// </summary>
        /// <param name="courseId">The course id.</param>
        /// <returns></returns>
        [OperationContract]
        List<Student> GetStudentsInCourse(int courseId);
        /// <summary>
        /// Gets the students not in course.
        /// </summary>
        /// <param name="courseId">The course id.</param>
        /// <returns></returns>
        [OperationContract]
        List<Student> GetStudentsNotInCourse(int courseId);
        /// <summary>
        /// Gets all levels.
        /// Author:Fiona Pan
        /// </summary>
        /// <returns>List of Level</returns>
        [OperationContract]
        List<Level> GetAllLevels();
        /// <summary>
        /// Generates course report.
        /// Author:Fiona Pan
        /// </summary>
        /// <param name="condition">the given condition</param>
        /// <returns>List of courselist</returns>
        [OperationContract]
        List<CourseList> GenerateCourseReport(Condition condition, int pageIndex, int pageSize, out int rowCount);
        /// <summary>
        /// Gets all courses.
        /// Author:Fiona Pan
        /// </summary>
        /// <returns>List of Course</returns>
        [OperationContract]
        List<Course> GetAllCourses(int pageIndex, int pageSize, out int rowCount);
        /// <summary>
        /// Gets courses by condition.
        /// Author:Fiona Pan
        /// </summary>
        /// <param name="courseName">string CourseName</param>
        /// <param name="courseStatus">bool CourseStatus</param>
        /// <returns>List of Course</returns>
        [OperationContract]
        List<Course> GetCoursesByCondition(string courseName, string courseStatus, int pageIndex, int pageSize, out int rowCount);
        /// <summary>
        /// Deletes course by id
        /// Author:Fiona Pan
        /// </summary>
        /// <param name="courseId">int courseId</param>
        [OperationContract]
        void DeleteCourseById(int courseId);
        /// <summary>
        /// Changes course status to close
        /// </summary>
        /// <param name="course">the given course</param>
        [OperationContract]
        void ChangeCourseStatus(Course inputCourse);
    }
}
